//
//  LYQMemandManageFooterCell.m
//  ZCProject
//
//  Created by Zheng on 2016/12/20.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQDemandManageFooterCell.h"

@implementation LYQDemandManageFooterCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.readImgv];
        [self.contentView addSubview:self.readLbl];
        [self.contentView addSubview:self.shareImgv];
        [self.contentView addSubview:self.shareLbl];
        [self.contentView addSubview:self.replyImgv];
        [self.contentView addSubview:self.replyLbl];
        
        [self layoutSubviewsInContentView];
    }
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_readImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kWScale(16));
        make.top.mas_equalTo(kWScale(16));
        make.bottom.mas_equalTo(-kWScale(16));
        make.height.equalTo(@(kWScale(14)));
        make.width.equalTo(@(kWScale(20)));
    }];
    
    [_readLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_readImgv.mas_right).offset(kWScale(4));
        make.centerY.equalTo(self).offset(-kWScale(0.5));
    }];
    
    [_shareImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_readLbl.mas_right).offset(kWScale(15));
        make.top.bottom.height.width.equalTo(_readImgv);
    }];
    
    [_shareLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_shareImgv.mas_right).offset(kWScale(4));
        make.centerY.equalTo(self).offset(-kWScale(0.5));
    }];
    
    [_replyImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_shareLbl.mas_right).offset(kWScale(15));
        make.top.bottom.height.width.equalTo(_readImgv);
    }];
    
    [_replyLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_replyImgv.mas_right).offset(kWScale(4));
        make.centerY.equalTo(self).offset(-kWScale(0.5));
    }];
}

#pragma mark - lazy load subviews
- (UIImageView *)readImgv {
    if (_readImgv) {
        return _readImgv;
    }
    
    _readImgv = [[UIImageView alloc] init];
    _readImgv.backgroundColor = kLYQBlue;

    return _readImgv;
}

- (UILabel *)readLbl {
    if (_readLbl) {
        return _readLbl;
    }
    
    _readLbl = [[UILabel alloc] init];
    _readLbl.text = @"阅读 200";
    _readLbl.textColor = kHexadecimal(@"666666");
    _readLbl.font = kWFont(15);
    
    return _readLbl;
}

- (UIImageView *)shareImgv {
    if (_shareImgv) {
        return _shareImgv;
    }
    
    _shareImgv = [[UIImageView alloc] init];
    _shareImgv.backgroundColor = kLYQBlue;
    
    return _shareImgv;
}

- (UILabel *)shareLbl {
    if (_shareLbl) {
        return _shareLbl;
    }
    
    _shareLbl = [[UILabel alloc] init];
    _shareLbl.text = @"分享 2";
    _shareLbl.textColor = kHexadecimal(@"666666");
    _shareLbl.font = kWFont(15);
    
    return _shareLbl;
}

- (UIImageView *)replyImgv {
    if (_replyImgv) {
        return _replyImgv;
    }
    
    _replyImgv = [[UIImageView alloc] init];
    _replyImgv.backgroundColor = kLYQBlue;
    
    return _replyImgv;
}

- (UILabel *)replyLbl {
    if (_replyLbl) {
        return _replyLbl;
    }
    
    _replyLbl = [[UILabel alloc] init];
    _replyLbl.text = @"回复 3";
    _replyLbl.textColor = kHexadecimal(@"666666");
    _replyLbl.font = kWFont(15);
    
    return _replyLbl;
}

@end
